package org.zqy.dao.impl;

import java.util.ArrayList;
import java.util.List;

import org.zqy.dao.ArticleDao;
import org.zqy.domain.Article;

/** 实现文章接口 */
public class ArticleDaoImpl extends BaseDaoImpl implements ArticleDao {

	@Override
	public boolean addContent(Article content) {
		return false;
	}

	@Override
	public ArrayList<Article> getAdvicesByTime(long startTime, long endTime) {
		return null;
	}

	@Override
	public boolean updateContent(int cid, Article content) {
		return false;
	}

	@Override
	public boolean deleteContent(int cid) {
		return false;
	}

	@Override
	public ArrayList<Article> getAdvicesByCondition(int condition) {
		return null;
	}

	@SuppressWarnings("unchecked")
	@Override
	public ArrayList<Article> getRankList() {
		return (ArrayList<Article>) queryByHql("from Article ");
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Article> getTipList() {
		return (ArrayList<Article>) queryByHql("from Article where type = 'tip' limit 4");
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Article> getNewsList() {
		return (ArrayList<Article>) queryByHql("from Article where type = 'news' limit 5");
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Article> getBaseList() {
		return (ArrayList<Article>) queryByHql("from Article where type = 'base' limit 6");
	}

}
